﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CJJCH.Web.Manage
{
    public partial class MainTop : PowerBase 
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            LaYear.Text = DateTime.Today.Year.ToString();
            LaMonth.Text = DateTime.Today.Month.ToString();
            LaDay.Text = DateTime.Today.Day.ToString();
            LaWeek.Text = GetWeek();
            lblName.Text = SessionRealName;
        }

        protected void LBExit_Click(object sender, EventArgs e)
        {
            Session.Abandon();
            Response.Write("<script language='javascript'>window.parent.location.href='Login.aspx';</script>");
            Response.End();
        }

        private string GetWeek()
        {
            string weekstr = DateTime.Now.DayOfWeek.ToString();
            switch (weekstr)
            {
                case "Monday": weekstr = "星期一"; break;
                case "Tuesday": weekstr = "星期二"; break;
                case "Wednesday": weekstr = "星期三"; break;
                case "Thursday": weekstr = "星期四"; break;
                case "Friday": weekstr = "星期五"; break;
                case "Saturday": weekstr = "星期六"; break;
                case "Sunday": weekstr = "星期日"; break;
            }

            return weekstr;
        }
    }
}